package com.yycx.module.avm.provider.handler;


import com.yycx.common.base.entity.EntityMap;
import com.yycx.common.mybatis.interceptor.PageInterceptor;
import com.yycx.common.mybatis.model.PageParams;
import com.yycx.common.mybatis.query.CriteriaQuery;
import com.yycx.module.avm.client.entity.AvmVideo;
import org.springframework.stereotype.Component;

/**
 * 收藏的视频
 * @author Administrator
 */
@Component("videoColleconHandler")
public class VideoColleconHandler implements PageInterceptor {

    @Override
    public void prepare(CriteriaQuery cq, PageParams pageParams, EntityMap params) {
        cq.addSelect("video.videoTitle title", "video.coverImage coverImage", "video.ossUrl","video.createTime");
        cq.eq("targetEntity", AvmVideo.class.getSimpleName());
        cq.eq("optType", 1);
        cq.createJoin(AvmVideo.class).setMainField("targetId");

    }
}
